import request from '@/libs/request'
import {getToken}  from '@/libs/util'
  import axios from 'axios'


/**
 * 获取分页数据
 */


const service = axios.create({
  baseURL: "", // api的base_url
  timeout: 30000  // 设置请求超时时间30s
})

const list = (params) => {
  debugger;
    return request({
        url: 'yhfg/yhfgconsultation/list',
      params,
        method: 'get'
    })
}

/**
 * 根据ID查找数据
 */
const get = (id) => {
    const params = {
        id: id
    }
    return request({
        url: '/yhfg/yhfgconsultation/get',
        params,
        method: 'get'
    })
}

/**
 * 添加数据
 */
const add = (data) => {
    return request({
        url: '/yhfg/yhfgconsultation/add',
        data,
        method: 'post'
    })
}

/**
 * 更新数据
 */
const update = (data) => {
    return request({
        url: '/yhfg/yhfgconsultation/update',
        data,
        method: 'post'
    })
}

/**
 * 删除数据
 * @param apiId
 */
const remove = (id) => {
    const data = {
        id: id
    }
    return request({
        url: '/yhfg/yhfgconsultation/remove',
        data,
        method: 'post'
    })
}

export default {
    list,
    get,
    add,
    update,
    remove
}
